package com.motorhome.h5.service.impl;

import com.motorhome.base.util.StringUtil;
import com.motorhome.h5.dao.CommonDao;
import com.motorhome.h5.domain.User;
import com.motorhome.h5.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: John
 */
@Service
public class CommonServiceImpl implements CommonService {

    @Autowired
    private CommonDao commonDao;

    @Override
    public User getUserByPhone(String phone) {
        if (StringUtil.isBlank(phone)) {
            return null;
        }
        return commonDao.getUserByPhone(phone);
    }

    @Override
    public User getUserById(Long userId) {
        if (userId == null) {
            return null;
        }
        return commonDao.getUserById(userId);
    }

}
